package com.lufei.dh.bottom.Fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.SpannedString;
import android.text.style.AbsoluteSizeSpan;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.lufei.dh.R;
import com.lufei.dh.bottom.vlayout.RootActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * 版权：易金卡沃 版权所有
 * <p>
 * 作者：lufei
 * <p>
 * 创建日期：2018/6/25
 * <p>
 * 描述：
 * <p>
 * 修订历史：
 */
public class Fragment2 extends Fragment {
    @BindView(R.id.id_f2_text)
    TextView idF2Text;
    @BindView(R.id.id_f2_button)
    Button idF2Button;
    Unbinder unbinder;
    @BindView(R.id.id_edit)
    EditText idEdit;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//        return super.onCreateView(inflater, container, savedInstanceState);
        Log.e("lufei", "2222");
        View view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment2, container, false);
        unbinder = ButterKnife.bind(this, view);

        SpannableString ss = new SpannableString("单笔最多提现1000元");//定义hint的值
        AbsoluteSizeSpan ass = new AbsoluteSizeSpan(26,true);//设置字体大小 true表示单位是sp

        ss.setSpan(ass, 0, ss.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);

        idEdit.setHint(new SpannedString(ss));
        idEdit.setGravity(Gravity.BOTTOM|Gravity.LEFT);
        return view;
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.e("lufei", "2222......");
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick({R.id.id_f2_text, R.id.id_f2_button})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.id_f2_text:
                break;
            case R.id.id_f2_button:
                startActivity(new Intent(getContext(), RootActivity.class));
                break;
        }
    }
}
